home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 7 / Amiga Format AFCD07 (Dec 1996, Issue 91).iso / serious / shareware / programming / aros / dos / setfiledate.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-12  |  1.9 KB  |  80 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: setfiledate.c,v 1.1 1996/09/11 12:54:47 digulla Exp $
  4.     $Log: setfiledate.c,v $
  5.     Revision 1.1  1996/09/11 12:54:47  digulla
  6.     A couple of new DOS functions from M. Fleischer
  7.  
  8.     Desc:
  9.     Lang: english
  10. */
  11. #include <clib/exec_protos.h>
  12. #include <dos/dosextens.h>
  13. #include <dos/filesystem.h>
  14. #include <clib/dos_protos.h>
  15. #include "dos_intern.h"
  16.  
  17. /*****************************************************************************
  18.  
  19.     NAME */
  20.     #include <clib/dos_protos.h>
  21.  
  22.     __AROS_LH2(BOOL, SetFileDate,
  23.  
  24. /*  SYNOPSIS */
  25.     __AROS_LHA(STRPTR,             name, D1),
  26.     __AROS_LHA(struct DateStamp *, date, D2),
  27.  
  28. /*  LOCATION */
  29.     struct DosLibrary *, DOSBase, 66, Dos)
  30.  
  31. /*  FUNCTION
  32.     Change the modification time of a file or directory.
  33.  
  34.     INPUTS
  35.     name - name of the file
  36.     date - new file time
  37.  
  38.     RESULT
  39.     !=0 if all went well, 0 else. IoErr() gives additional
  40.     information in that case.
  41.  
  42.     NOTES
  43.  
  44.     EXAMPLE
  45.  
  46.     BUGS
  47.  
  48.     SEE ALSO
  49.  
  50.     INTERNALS
  51.  
  52.     HISTORY
  53.     29-10-95    digulla automatically created from
  54.                 dos_lib.fd and clib/dos_protos.h
  55.  
  56. *****************************************************************************/
  57. {
  58.     __AROS_FUNC_INIT
  59.     __AROS_BASE_EXT_DECL(struct DosLibrary *,DOSBase)
  60.  
  61.     /* Get pointer to process structure */
  62.     struct Process *me=(struct Process *)FindTask(NULL);
  63.  
  64.     /* Get pointer to I/O request. Use stackspace for now. */
  65.     struct IOFileSys io,*iofs=&io;
  66.  
  67.     /* Prepare I/O request. */
  68.     iofs->IOFS.io_Message.mn_Node.ln_Type=NT_REPLYMSG;
  69.     iofs->IOFS.io_Message.mn_ReplyPort   =&me->pr_MsgPort;
  70.     iofs->IOFS.io_Message.mn_Length      =sizeof(struct IOFileSys);
  71.     iofs->IOFS.io_Flags=0;
  72.     iofs->IOFS.io_Command=FSA_SET_DATE;
  73.     /* io_Args[0] is the name which is set by DoName(). */
  74.     iofs->io_Args[1]=date->ds_Days;
  75.     iofs->io_Args[2]=date->ds_Minute;
  76.     iofs->io_Args[3]=date->ds_Tick;
  77.     return !DoName(iofs,name);
  78.     __AROS_FUNC_EXIT
  79. } /* SetFileDate */
  80.